import { ControlVOBase, EditFormService } from '@core';
import { LawSupportService } from '@api/law-support/law-support-service';

/**
 * 部件展示数据对象
 * @export
 * @class ControlVO
 */
export class ControlVO extends ControlVOBase {
  /**
   * 用后台数据对象创建部件数据对象
   * @param data 后台数据
   */
  constructor(data: any){
    super(data);
    // 记录没有映射的属性
    this.$ownKeys =['srfupdatedate','srforikey','srfkey','srfmajortext','srftempmode','srfuf','srfdeid','srfsourcekey','ls_law_supportname','draftman','deptname','draftdate','createmantelnum','num','supporttype','requmemo','requattachment','lawyj','attachment','certificate','draftmanid','deptid','draftdeptyj','lawdeptyj','ls_law_supportid'];  
  }

  // 表单里映射了属性的字段
  get srfupdatedate() {
    return this.$DO.updatedate;
  }
  set srfupdatedate(value: any) {
    this.$DO.updatedate = value;
  }

  get srfkey() {
    return this.$DO.lawsupportid;
  }
  set srfkey(value: any) {
    this.$DO.lawsupportid = value;
  }

  get srfmajortext() {
    return this.$DO.lawsupportname;
  }
  set srfmajortext(value: any) {
    this.$DO.lawsupportname = value;
  }

  get ls_law_supportname() {
    return this.$DO.lawsupportname;
  }
  set ls_law_supportname(value: any) {
    this.$DO.lawsupportname = value;
  }

  get draftman() {
    return this.$DO.draftman;
  }
  set draftman(value: any) {
    this.$DO.draftman = value;
  }

  get deptname() {
    return this.$DO.deptname;
  }
  set deptname(value: any) {
    this.$DO.deptname = value;
  }

  get draftdate() {
    return this.$DO.draftdate;
  }
  set draftdate(value: any) {
    this.$DO.draftdate = value;
  }

  get createmantelnum() {
    return this.$DO.createmantelnum;
  }
  set createmantelnum(value: any) {
    this.$DO.createmantelnum = value;
  }

  get num() {
    return this.$DO.num;
  }
  set num(value: any) {
    this.$DO.num = value;
  }

  get supporttype() {
    return this.$DO.supporttype;
  }
  set supporttype(value: any) {
    this.$DO.supporttype = value;
  }

  get requmemo() {
    return this.$DO.requmemo;
  }
  set requmemo(value: any) {
    this.$DO.requmemo = value;
  }

  get requattachment() {
    return this.$DO.requattachment;
  }
  set requattachment(value: any) {
    this.$DO.requattachment = value;
  }

  get attachment() {
    return this.$DO.attachment;
  }
  set attachment(value: any) {
    this.$DO.attachment = value;
  }

  get certificate() {
    return this.$DO.certificate;
  }
  set certificate(value: any) {
    this.$DO.certificate = value;
  }

  get draftmanid() {
    return this.$DO.draftmanid;
  }
  set draftmanid(value: any) {
    this.$DO.draftmanid = value;
  }

  get deptid() {
    return this.$DO.deptid;
  }
  set deptid(value: any) {
    this.$DO.deptid = value;
  }

  get ls_law_supportid() {
    return this.$DO.lawsupportid;
  }
  set ls_law_supportid(value: any) {
    this.$DO.lawsupportid = value;
  }


  // 表单里没有映射实体属性的字段(srfuf除外)
  srforikey: any;
  srftempmode: any;
  srfdeid: any;
  srfsourcekey: any;
  lawyj: any;
  draftdeptyj: any;
  lawdeptyj: any;
}

// 部件配置对象
export const ctrlState = {
  controlCodeName: 'Main6',
  controlName: 'form',
  controlService: new EditFormService<ControlVO>(ControlVO, new LawSupportService() ),
  data: new ControlVO({}),
  appDeKeyFieldName: 'LawSupportId',
  appDeMajorFieldName: 'LawSupportName',
  enableAutoSave: false,
  detailsModel: {
    formpage1: {
      caption: '基本信息',
      name: 'formpage1',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMPAGE',
      showCaption: false,
    },
    group1: {
      caption: '法律支撑基本信息',
      name: 'group1',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'GROUPPANEL',
      showCaption: true,
    },
    ls_law_supportname: {
      caption: '标题',
      name: 'ls_law_supportname',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: true,
      enableCond: 0,
    },
    draftman: {
      caption: '起草人',
      name: 'draftman',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
      createDVT: "APPDATA",
      createDV: "srfpersonid",
    },
    deptname: {
      caption: '起草部门名称',
      name: 'deptname',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    draftdate: {
      caption: '起草时间',
      name: 'draftdate',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      dataType: '5',
      required: false,
      enableCond: 0,
      createDVT: "CURTIME",
      createDV: "",
    },
    createmantelnum: {
      caption: '联系电话',
      name: 'createmantelnum',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    num: {
      caption: '单号',
      name: 'num',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    supporttype: {
      caption: '支撑类型',
      name: 'supporttype',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    requmemo: {
      caption: '需求说明',
      name: 'requmemo',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: true,
      enableCond: 3,
    },
    requattachment: {
      caption: '需求附件',
      name: 'requattachment',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '21',
      required: false,
      enableCond: 3,
    },
    lawyj: {
      caption: '法律支撑意见',
      name: 'lawyj',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    attachment: {
      caption: '法律支撑附件',
      name: 'attachment',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '21',
      required: false,
      enableCond: 3,
    },
    certificate: {
      caption: '证照上传',
      name: 'certificate',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '21',
      required: false,
      enableCond: 3,
    },
    draftmanid: {
      caption: '起草人id',
      name: 'draftmanid',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 3,
    },
    deptid: {
      caption: '起草部门标识',
      name: 'deptid',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      valueFormat: '',
      dataType: '25',
      required: false,
      enableCond: 3,
    },
    grouppanel1: {
      caption: '审批意见',
      name: 'grouppanel1',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'GROUPPANEL',
      showCaption: true,
      groupLogics: [
        {
          name: '表单成员[grouppanel1][面板显示]逻辑',
          groupOP: 'AND',
          relatedDetailNames: '[supporttype]',
          logicCat: 'PANELVISIBLE',
          logicType: 'GROUP',
          notMode: false,
          logics: [
          {condOP: 'EQ',dEFDName: 'supporttype',logicType: 'SINGLE',name: 'supporttype 等于(=) (30)',value:'30'},
          ],
        },
      ],
    },
    draftdeptyj: {
      caption: '起草部门领导意见',
      name: 'draftdeptyj',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      dataType: '25',
      required: false,
      enableCond: 0,
    },
    lawdeptyj: {
      caption: '法务部门领导意见',
      name: 'lawdeptyj',
      disabled: false, 
      visible: true,
      detailStyle: 'DEFAULT',
      detailType: 'FORMITEM',
      showCaption: true,
      dataType: '25',
      required: false,
      enableCond: 0,
    },
  },
  actionModel: {
  },
  rules: {
  },
};